package com.example.design.patterns.冰河.结构型模式.享元模式;

import com.example.design.patterns.冰河.结构型模式.享元模式.flyWeight.FlyWeight;
import com.example.design.patterns.冰河.结构型模式.享元模式.flyWeightFactory.FlyWeightFactory;

public class Test {
    public static void main(String[] args) {
        FlyWeight fly1 = FlyWeightFactory.getFlyWeight("a");
        fly1.action(1);

        FlyWeight fly2 = FlyWeightFactory.getFlyWeight("b");
        fly1.action(2);
        FlyWeight fly3 = FlyWeightFactory.getFlyWeight("c");
        fly1.action(3);
        FlyWeight fly4 = FlyWeightFactory.getFlyWeight("f");
        fly1.action(4);

        System.out.println(FlyWeightFactory.getSize());
    }
}
